//  标准体重
import MeasureItem from './MeasureItem'

const UI = require('./UI');

var isAdd = false;
export default class StandWeightReport {

  static getStand(measure) {
    let weightControl;
    if (measure.gender == 0) {
      weightControl = ((measure.height * 1.37) - 110) * 0.45;
    } else {
      weightControl = (measure.height - 80) * 0.7;
    }

    return weightControl;
  }

  static isEnable(measure) {
    return true
  }

  static build(measure) {

    const value = StandWeightReport.getStand(measure);
    let desc = '';
    const unit = "kg";
    const item = new MeasureItem();
    desc = "根据您的身高和年龄，您的标准体重是" + (+value).toFixed(1) + unit;
    item.name = "标准体重";
    item.value = value;
    item.unit = unit;
    item.levelNames = ["标准"];
    item.bar = [UI.color.report_stand];
    item.showBar = false;
    item.desc = desc;
    item.levelName = item.levelNames[0]
    item.levelColor = item.bar[0]

    return item
  }

}



// WEBPACK FOOTER //
// ./src/report/StandWeight.js
